A network packet processor may input a stream of network packets, manipulate the contents of the network packets, and output another stream of modified network packets. The manipulations may implement a protocol for processing network packets. For example, the network packet processor may implement a protocol layer of a communication protocol, and for a high-level packet received from a higher protocol layer and delivered to a lower protocol layer for eventual transmission on the communication media, the manipulations may encapsulate the high-level packet within a low-level packet of the lower protocol layer.
A protocol designer may develop a specification of the processing of network packets by a network packet processor. A hardware designer, such as an integrated circuit designer, may create a hardware implementation of a network packet processor that complies with the requirements specified by the protocol designer. Thus, development of a network packet processor implemented in hardware may require the specialized knowledge and skills of at least two separate fields of expertise. Because multiple fields of expertise may be required during development of a hardware implementation of a network packet processor, development of a network packet processor may be time consuming and expense.
Rapid development of the protocol or implementation of a network packet processor may improve the timeliness and/or quality of the network packet processor. For example, if a hardware implementation can be generated quickly given a specification of the processing of network packets, deficiencies discovered in an initial implementation may be addressed by modifying the specification and generating an improved implementation. Additional iterations of improvement may be possible if the hardware implementation can be generated quickly from a protocol specification.
It is often desirable to optionally insert or remove a fixed amount of data in a particular location in an existing data stream. Some machines allow inserting data only at certain points in the data stream, such as at the beginning or end of a field (e.g., a header segment) or at a byte boundary. Others are limited to a single fixed-size insertions or deletions. As the packet network environment becomes more complex and the nature of the data and insertion/deletion points more general, such machines can become physically large. Furthermore, user-designed machines are often tedious to develop and often are too error-prone to incorporate into a large complier.